unit uMainForm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, OleCtrls, SHDocVw;

type
  IWebControl = class;
  
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    FWebControl: IWebControl;
  end;

  IWebControl = class
    procedure SetWidth(width: Integer); virtual; stdcall; abstract;
    procedure SetHeight(height: Integer); virtual; stdcall; abstract;
    procedure SetLeft(left: Integer); virtual; stdcall; abstract;
    procedure SetTop(top: Integer); virtual; stdcall; abstract;
    procedure SetParentWnd(parentWnd: THandle); virtual; stdcall; abstract;
    procedure Navigate(url: PChar); virtual; stdcall; abstract; 
    procedure Release; virtual; stdcall; abstract;
  end;

  function CreateWebControl: IWebControl; stdcall; external 'webdll.dll' name 'CreateWebControl';
    
var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  FWebControl := CreateWebControl;
  FWebControl.SetParentWnd(Handle);
  FWebControl.Navigate('163.com');
  FWebControl.SetWidth(Width);
  FWebControl.SetHeight(Height);
end;

end.
